home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / lineed.zip / TIMERS.H < prev    next >
Text File  |  1992-01-16  |  449b  |  11 lines

  1. /*  Macros for implementing simple timers.  All timers use 1000ths of
  2.     a second, but are only 'accurate' to one clock tick. */
  3.  
  4. #ifndef CLOCKS_PER_SEC
  5.     #define CLOCKS_PER_SEC CLK_TCK
  6. #endif
  7.  
  8.  #define timerset(tmt) (clock_t)((((clock_t)(tmt) * (clock_t)CLOCKS_PER_SEC) / 1000L) + clock())
  9.  #define timeup(tmt) ((clock_t)(tmt) < clock())
  10.  #define timeleft(tmt) (clock_t)((((clock_t)(tmt) - clock()) / (clock_t)CLOCKS_PER_SEC) * 1000L)
  11.